# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=urldigger
pkgver=02c
pkgrel=5
groups=('blackarch' 'blackarch-webapp' 'blackarch-scanner')
pkgdesc='A python tool to extract URL addresses from different HOT sources and/or detect SPAM and malicious code'
arch=('any')
url='https://code.google.com/p/urldigger/'
license=('MIT')
depends=('python2')
source=("https://urldigger.googlecode.com/files/$pkgname-$pkgver.tar.gz")
sha512sums=('ed64a2745c7121bef7fa79c5d18f669efc1ba869')

package() {
  cd "$pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" README CHANGELOG

  rm README CHANGELOG

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec python2 /usr/share/$pkgname/urldigger.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

